<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Jacov\JacovBundle\Model;

use Jacov\JacovBundle\Entity\Gallery;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;

class GalleryModel
{
    public function __construct($entityManager)
    {
        $this->entityManager = $entityManager;
    }
    
    public function getPictures($page)
    {
        $this->Pages = new Gallery();
        $query = $this->entityManager->createQuery(
            'SELECT g.id,g.title ,g.path
            FROM JacovJacovBundle:Gallery g WHERE g.type=:data  ORDER BY g.id DESC'
        )->setParameter('data', $page);
        return $query->getResult();
    }
}

